<!DOCTYPE html>
<!--培训需求矩阵管理 课程添加编辑-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>


</head>

<body>


    <div id="app" v-cloak class="popupW100">

        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">
            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div> {{TrainingDemandMatrixManagement.course+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.course" slot="suffix"
                                    :placeholder="TrainingDemandMatrixManagement.course">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in course" :label="item.value" :value="item.value">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <div class="elst-select-mini">
                                <el-input size="mini">
                                    <template slot="prepend">
                                        {{TrainingDemandMatrixManagement.LastTrainingTime+mark.m}}
                                    </template>
                                    <el-date-picker slot="suffix" v-model="Form.LastTrainingTime" type="date"
                                        size="mini" format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                    </el-date-picker>
                                </el-input>
                            </div>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <el-row>
                <el-col :sqpn="24">
                    <el-col :span="20">
                        <div class="elst-select-mini">
                            <el-form-item prop="TrainingFrequency">
                                <el-input type="text" v-model="Form.TrainingFrequency" autocomplete="off" size="mini">
                                    <template slot="prepend">
                                        {{TrainingDemandMatrixManagement.TrainingFrequency+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="4">
                        <div class="elst-select-mini">
                            <span  class="fr">
                                年/次
                            </span>
                        </div>
                    </el-col>
                </el-col>
            </el-row>
            <br>
            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
    </div>
    <script type="text/javascript">
        var app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                course: [],
                //业务表单内容
                Form: {
                    course: '',
                    LastTrainingTime: '',
                    TrainingFrequency: '',
                    course: '',
                },
                TrainingFrequency: [],
                //表单验证
                rules: {
                    course: [
                        verification.NotNull
                    ],
                    LastTrainingTime: [
                        verification.NotNull
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function () {
                    this.Form.TrainingFrequency = this.Form.TrainingFrequency + ' 年/次'
                    var course = this.Form.course;
                    var LastTrainingTime = this.Form.LastTrainingTime;

                    parent.app.Form.CourseList.push({
                        course: course,
                        LastTrainingTime: LastTrainingTime,
                        TrainingFrequency: this.Form.TrainingFrequency
                    });
                    parent.app.ListItem.dialogVisible = false;
                },
                getData: function () {
                    this.Form.course = this.Form.course + "";
                }
            },
            mounted: function () {
                this.TrainingFrequency = getDicData('50');
                this.course = getDicData('83');

            },
        });
    </script>
</body>

</html>